import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class myMessageList extends StatefulWidget {
  myMessageList({Key key, this.cartoon_list}) : super(key: key);
  List cartoon_list;
  @override
  State<myMessageList> createState() => _myMessageListState();
}

class _myMessageListState extends State<myMessageList> {
  @override
  Widget build(BuildContext context) {
    return Wrap(
      // spacing: 10,
      children: widget.cartoon_list
          .map((e) => GestureDetector(
                onTap: () {
                  print(e['cartoon_id']);
                },
                child: Container(
                  margin: EdgeInsets.only(left: 4, right: 4, bottom: 8),
                  // color: Colors.red,
                  width: 120,
                  height: 210,
                  child: OverflowBox(
                    child: Column(
                      children: [
                        Container(
                          decoration: new BoxDecoration(
                            color: Color.fromRGBO(255, 255, 255, 1),
                            // 设置四周圆角，角度
                            borderRadius:
                                BorderRadius.all(Radius.circular(4.0)),
                            border: new Border.all(
                                color: Colors.black38, width: 0.5),
                          ),
                          height: 160,
                          width: 120,
                          child: Image(
                              fit: BoxFit.fill,
                              image: NetworkImage(e['cartoon_leader_image'])),
                        ),
                        // Expanded(child: SizedBox()),
                        Row(children: [
                          Container(
                            margin: EdgeInsets.only(bottom: 4),
                            width: 120,
                            child: Text(
                              e['cartoon_name'],
                              style: TextStyle(fontSize: 12),
                            ),
                          ),
                        ]),
                      ],
                    ),
                  ),
                ),
              ))
          .toList(),
    );
  }
}
